package com.hybs.service.impl;/*
 * @author: Hayabusa
 * @date: 2021/9/14 22:33
 * @Description:
 * @Email:2682557218@qq.com
 */

import com.hybs.dao.ProductDao;
import com.hybs.entity.Product;
import com.hybs.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ProductServiceImpl implements ProductService {
    @Autowired
    private ProductDao productDao;
    @Override
    public Product findById(Long id) {
        return productDao.findById(id).get();
    }

    @Override
    public void save(Product product) {
        productDao.save(product);

    }

    @Override
    public void update(Product product) {
        productDao.save(product);

    }

    @Override
    public void delete(Long id) {
        productDao.deleteById(id);

    }
}
